<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html lang="en">
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>  
<base href="<%=basePath%>">
        <head>
            <meta charset="utf-8">
            <title>考生登录</title>
            <link rel="stylesheet" href="<%=path%>/views/static/layui-v2.5.6/layui/css/layui.css">
            <link rel="stylesheet" href="views/static/layui-v2.5.6/layui/css/layui.css">
            <script type="text/javascript" src="<%=path%>/views/static/jquery-3.3.1.js" >
    </script>
    <script type="text/javascript" >

      function reloadCheckImg()
      {
          $("#checkcode").attr("src", "img.jsp?t="+(new Date().getTime()));  //<img src="...">
      }

      $(document).ready(function(){


        $("#checkcodeId").blur(function(){

          var $checkcode = $("#checkcodeId").val();
          //校验   :文本框中输入的值 发送到服务端。
           //服务端： 获取文本框输入的值 ，和真实验证码图片中的值对比 ，并返回验证结果
          $.post(
                  "CheckCode1",//服务端地址
                  "checkcode="+$checkcode,
                  function(result){//图片地址（imgs/right.jpg   imgs/wrong.jpg）
                    //result:  imgs/right.jpg
                  var resultHtml =  $("<img src='"+result+"' height='15' width='15px' id='check'  />") ;
                  //var resultHtml =  $("<img src='imgs/right.jpg' height='15' width='15px'   />") ;
                    $("#tip").html(resultHtml);
                  }
          );

        });

      });
    </script>
    
    
            <style type="text/css">
          		.container{
          			width: 420px;
          			height: 420px;
    		 		 min-height: 420px;  
    		 		 max-height: 420px;  
    		 		 position: absolute;   
    		 		 top: 0;  
    		 		 left: 0;  
    		 		 bottom: 0;  
    		 		 right: 0;  
    		 		 margin: auto;  
    		 		 padding: 20px;  
    		 		 z-index: 130;  
    		 		 border-radius: 8px;  
    		 		 background-color:#F8F8F8;
    		 		 box-shadow: 0 3px 18px rgba(100, 0, 0, .5); 
    		 		 font-size: 16px;
          		}
          		.close{
          			background-color: white;
          			border: none;
          			font-size: 18px;
          			margin-left: 410px;
          			margin-top: -10px;
          		}
     
            	.layui-input{
            		border-radius: 5px;
            		width: 300px;
            		height: 40px;
            		font-size: 15px;
            	}
            	.layui-form-item{
            		margin-left: -20px;
            	}
    			#logoid{ 
    				margin-top: -16px;
    		 		 padding-left:140px; 
    		 		 padding-bottom: 15px;
    			}
    			.layui-btn{
    				margin-left: -50px;
    				border-radius: 5px;
            		width: 350px;
            		height: 40px;
            		font-size: 15px;
    			}
    			.verity{
    				width: 120px;
    			}
    			.font-set{
    				font-size: 13px;
    				text-decoration: none; 
    				margin-left: 120px;
    			}
    			a:hover{
    			 text-decoration: underline; 
    			}
				
				#atuo{
					position:relative;
					top: 5px;
				}
				
				#rmbpw{
					position:relative;
					top: 5px;
				}
				
     
            </style>
        </head>
        <body id="bd" background="<%=path%>/views/static/imgs/background.png" style="background-repeat: no-repeat;background-size: 100% 100%;background-attachment: fixed;">
        	<form class="layui-form" action="controller/login_check.action" method="post" onsubmit="return eg.regCheck();">
        		<div class="container" style="position: relative; left: 400px; top: 150px;">
        			<button class="close" title="关闭">X</button>
        			<div class="layui-form-mid layui-word-aux">
        				<img src="<%=path%>/views/static/imgs/登录.png" width="140" height="72" id="logoid">    				
        			</div>
    			  <div class="layui-form-item">
    			    <label class="layui-form-label"><i class="layui-icon layui-icon-username" style="font-size: 25px; color: #1E9FFF;"></i></label>
    			    <div class="layui-input-block">
    			      <input type="text" name="uname" required  lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input">
    			    </div>
    			  </div>
    			  <div class="layui-form-item">
    			    <label class="layui-form-label"><i class="layui-icon layui-icon-password" style="font-size: 25px; color: #1E9FFF;"></i></label>
    			    <div class="layui-input-inline">
    			      <input type="password" name="upwd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
    			    </div>
    			    <!-- <div class="layui-form-mid layui-word-aux">辅助文字</div> -->
    			  </div>
    			   <div class="layui-form-item">
    			    <label class="layui-form-label"><i class="layui-icon layui-icon-vercode" style="font-size: 25px; color: #1E9FFF;"></i></label>
    			    <div class="layui-input-inline">
    			      <input type="text" name="checkcode" id="checkcodeId" size="4" required  lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input verity">
    			      <a href="javascript:reloadCheckImg();" style="position:absolute;top: 5px;left: 135px;"> <img src="img.jsp" id="checkcode"/></a>
        			  <span id="tip" style="position: absolute;top: 11px;left: 230px;">  </span>
    			    </div>
    			    <!-- <div class="layui-form-mid layui-word-aux">辅助文字</div> -->
    			      
    			  </div>
    			  
				<div class="layui-form-item" pane="">
				<div class="layui-input-block">
				  <div><span id="atuo">自动登录</span>&nbsp;&nbsp;<input type="checkbox" name=" 	" lay-skin="primary" title="">&nbsp;&nbsp;&nbsp;&nbsp;
				  <span id="rmbpw">记住密码</span>&nbsp;&nbsp;<input type="checkbox" name="like1[rmbpw]" lay-skin="primary" title="" ></div>
				</div>
			    </div>
    			  
    			  
     
    			  <div class="layui-form-item">
    			    <div class="layui-input-block">
    			      <button class="layui-btn layui-btn layui-btn layui-btn-warm layui-btn-radius" lay-submit lay-filter="formDemo" >立即登录></button>	     
    			    </div>
				  </div>
				  
    			  <div style="position: relative;left: -80px;">
				   <a href="views/forget_password.jsp" class="font-set" style="position: relative;top: 4px;"><span style="color: #1E9FFF;">忘记密码？</span></a>
				   <div style="position: relative;top: -20px;left: 250px;">
						<a href=""><i class="layui-icon layui-icon-login-wechat" style="font-size: 22px; color:lime;"></i></a>  
						<a href=""><i class="layui-icon layui-icon-login-qq" style="font-size: 22px; color:skyblue;"></i></a> 
						<a href=""><i class="layui-icon layui-icon-login-weibo" style="font-size: 22px;"></i></a> 
						<a href="register.jsp" class="font-set" style="position:relative;left: -30px;"><span style="color: #1E9FFF;">立即注册></span></a>
				   </div>
				   
				  </div>

				</div>


				<div style="position: relative;top: -400px;left: 200px;">
					<span style="font-size:60px; color:white;font-weight:bold;">用科技</span>
					<br>
					<span style="font-size:30px;color:white;font-weight: lighter;">让考研简单不孤单</span>
				</div>
			
				<div style="position:relative;left: 100px;">
					<a href="#"><span style="color: white;">帮助中心</span></a>&nbsp;&nbsp;<span style="color: white;">|</span>&nbsp;&nbsp;
					<a href="#"><i class="layui-icon layui-icon-chat" style="font-size: 20px; color:white;"></i></a>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<span style="color: white;">2020@Yiyanxun</span>
				</div>
    		</form>
    		<script type="text/javascript" src="<%=path%>/views/static/layui-v2.5.6/layui/layui.js"></script>
    		<script type="text/javascript" src="views/static/layui-v2.5.6/layui/layui.js"></script>
    		<script>
    			layui.use(['form', 'layedit', 'laydate'], function(){
    			  var form = layui.form
    			  ,layer = layui.layer
    			  ,layedit = layui.layedit
    			  ,laydate = layui.laydate;
    			  
    			  
    			  //监听提交
    			  form.on('submit(demo1)', function(data){
    			    layer.alert(JSON.stringify(data.field), {
    			      title: '最终的提交信息'
    			    })
    			    return false;
    			  });
    			 
    			});
    			</script>
    			
    			<script>
		var eg = {};
		eg.$ = function(id){
			return document.getElementById(id);
		};
	
		eg.regCheck = function(){
		var src1 = eg.$("check").src;
			if(src1=="http://localhost:8080/Graduation_info/imgs/wrong.jpg"){
				alert('输入验证码错误，请重新输入！！！');
				return false;
			}
		return true;
			};
	</script>
        </body>
    </html>